package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"

	cent "gitee.com/shuokeyun/common/ent"
)

// Item schema.
type Item struct {
	ent.Schema
}

func (Item) Mixin() []ent.Mixin {
	return []ent.Mixin{
		cent.OrmMixin{},
	}
}

// Annotations of the item.
func (Item) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.Annotation{
			Table: "sk_item",
		},
	}
}

// Fields of the item.
func (Item) Fields() []ent.Field {
	return []ent.Field{
		field.String("code").Immutable().Comment("项目编码"),
		field.String("name").Comment("项目名简称"),
		field.String("full_name").Comment("项目完整名"),
		field.Int32("price_area").Immutable().Comment("物价区域"),
		field.Int32("brand").Immutable().Comment("品牌"),
		field.Int8("status").Comment("状态 0下架;1上架"),
		field.Int32("market_price").Comment("市场价(分)"),
		field.Int32("cost_price").Comment("成本价(分)"),
		field.Int8("custom_combo").Comment("是否自定义套餐,自定义的下单后为子项"),
		field.Int8("can_separate").Comment("是否可以单独项检测 0否;1是"),
		field.String("checked_with_item").Comment("一起检测项目"),
		field.Int8("sex_limit").Comment("性别限制 0不限;1男;2女"),
		field.String("child_item").Comment("子项目明细,逗号隔开"),
		field.String("reject_item").Comment("排斥项目,逗号分隔"),
		field.String("test_qty_desc").Comment("标本量描述"),
		field.Float32("test_qty").Comment("标本量,单位ml"),
		field.String("storage_condition").Comment("存储要求"),
		field.String("test_method").Comment("检测方法"),
		field.String("report_time_desc").Comment("报告时间描述"),
		field.String("consumable").Comment("耗材"),
		field.Int8("empty_stomach").Comment("是否空腹 0否;1是"),
		field.String("significance").Comment("检验意义"),
		field.Int32("category_id").Comment("分类id"),
	}
}
